import ThemedImage from "@theme/ThemedImage";

# Integrations

## Mail Server Setup

If you are self-hosting Touca, we strongly recommend that you configure a mail
server for your instance to help you and your colleagues receive emails such as
reports about comparison results of newly submitted versions.

You can configure a mail server using the "Mail Transport" tab of the Settings
page. You must be logged in as the server owner (the user account you creating
during Touca server installation) in order to access this tab.

<ThemedImage
  alt="Mail Server Configuration Tab"
  sources={{
    light:
      "https://touca.io/docs/external/assets/touca-page-settings-tab-mail.light.png",
    dark: "https://touca.io/docs/external/assets/touca-page-settings-tab-mail.dark.png"
  }}
/>

Click on "Configure" to enter mail server configuration parameters. Be sure that
the port you specify is open and accessible and the machine that is running
Touca server.

<ThemedImage
  alt="Mail Server Configuration Form"
  sources={{
    light:
      "https://touca.io/docs/external/assets/touca-server-integrations-mail-form.light.png",
    dark: "https://touca.io/docs/external/assets/touca-server-integrations-mail-form.dark.png"
  }}
/>

### Managing Email Notifications

You can subscribe to a given suite to get notified of important events about it.
These events include:

- When a team member promotes a new version to baseline.
- When a team member adds a note to a given version.
- When a new version is submitted that is different from the baseline.

You can also opt-in to receive notifications about new versions that match the
behavior and performance of baseline version.

<ThemedImage
  alt="Touca Test Case Overview page"
  sources={{
    light:
      "https://touca.io/docs/external/assets/touca-suite-subscribe.light.png",
    dark: "https://touca.io/docs/external/assets/touca-suite-subscribe.dark.png"
  }}
/>

When a new version has differences compared to the baseline, the notification
will include a summary of those differences. You can always click on "View
Results" to inspect the differences on the Touca server.

<ThemedImage
  alt="Sample email when version has differences"
  sources={{
    light:
      "https://touca.io/docs/external/assets/touca-email-version-different.light.png",
    dark: "https://touca.io/docs/external/assets/touca-email-version-different.light.png"
  }}
/>

When someone on your team promotes a new version as baseline, the notification
will include any note they may have written as justification.

<ThemedImage
  alt="Sample email when new version is promoted"
  sources={{
    light:
      "https://touca.io/docs/external/assets/touca-email-version-promote.light.png",
    dark: "https://touca.io/docs/external/assets/touca-email-version-promote.light.png"
  }}
/>

Lastly, if you choose to receive notifications about all new versions, you may
rely on emails from Touca as confirmation that a new version matches the
baseline.

<ThemedImage
  alt="Sample email when version matches baseline"
  sources={{
    light:
      "https://touca.io/docs/external/assets/touca-email-version-same.light.png",
    dark: "https://touca.io/docs/external/assets/touca-email-version-same.light.png"
  }}
/>
